package com.joysuch.wwyt.core.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @Author ZhaoQiuWei
 * @Date 2021/10/27 10:43
 */
public enum RriskFactorEnum {
    REN(1, "人(人的不安全行为)"),
    WU(2, "物(物的不安全状态)"),
    HUAN(3, "环(环境因素)"),
    GUAN(4, "管(管理因素)");

    private int index;

    private String value;

    RriskFactorEnum(int index, String value) {
        this.index = index;
        this.value = value;
    }

    public static boolean checkByValue(String value) {
        if (StringUtils.isNotBlank(value)) {
            value = value.trim();
            RriskFactorEnum[] enums = RriskFactorEnum.values();
            for (RriskFactorEnum e : enums) {
                if (e.value.equals(value)) {
                    return true;
                }
            }
        }
        return false;
    }


}
